<div id="chat-form">

<fieldset>
<legend>Thảo luận</legend>

<?php if (!$session->check("Account.logged") || $session->read("Account.logged") == "NO") { ?>
<p>Bạn hãy đăng nhập để cùng thảo luận về món ăn này</p>
<?php } else { ?>
<?php echo $ajax->form(array('type' => 'post', 'options' => array( 'model'=>'Comment', 'update'=>'chat-form', 'before' => 'Element.show("chat-loader");Form.disable("chat-button");', 'complete' => 'Element.hide("chat-loader");Form.enable("chat-button");', 'url' => array("controller" => "comments", "action" => "post/".$recipe_permalink))));?>
<?php //echo $form->create("Comment", array("url" => "/comments/post/".$recipe_permalink)); ?>
<ul>
<li>
  <div class="group">
  <div>
  <?php if (!empty($message_done)) { ?>
  <p><?php echo $message_done ?></p>
  <?php } ?>
  <?php echo $form->input("Comment.content", array("class" => "textarea medium", "label" => array("class" => "desc", "text" => "Nội dung <span class=\"req\">*</span>"), "error" => array("wrap" => "p", "class" => "error"))); ?>
  <br />
  <?php echo $form->button("Gửi", array("id" => "chat-button", "class" => "button", "type" => "submit", "style" => "width:100px;")); ?>
  <?php echo $html->image("ajax-loader.gif", array("id" => "chat-loader", "style" => "display:none;")); ?>
  </div>
  </div>
</li>
</ul>
<?php echo $form->end(); ?>
<?php } ?>

<?php if (!empty($comments)) { foreach ($comments as $comment) { ?>
<p style="border-bottom: 1px dotted #ccc;">
<strong style="margin: 0 0 0 -10px;"><?php echo $teefan->displayContent($comment["Account"]["name"]); ?>: </strong><!-- <a href="#">xóa bình luận này</a> -->
<br />
<?php echo $teefan->displayContent($comment["Comment"]["content"]); ?>
</p>
<p class="line"></p>
<?php } } ?>

</fieldset>

<fieldset>
<legend>Thảo luận dành cho các bạn dùng Facebook</legend>

<fb:comments width="455px"></fb:comments>

</fieldset>

</div>